<include file="public@header" />
<link rel="stylesheet" href="__TMPL__/public/assets/css/bootstrap-grid.min.css">
<link rel="stylesheet" href="__TMPL__/public/assets/css/zoomify.min.css">
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a href="{:url('goods/index')}">商品列表</a></li>
			<li><a href="{:url('goods/add')}">新增商品</a></li>

		</ul>
		<form class="well form-inline margin-top-20" method="post" action="{:url('Goods/index')}">
            商品名:
         <input type="text" class="form-control" name="g_goodsname" style="width: 120px;" value="{:input('request.g_goodsname/s','')}" placeholder="请输入商品名">
			店铺类型：
			<select class="form-control" name="stortype" style="width: 140px;">
				<foreach name="stortype" item="stortype">
					<option value='{$stortype.id}'>{$stortype.cat_name}</option>
				</foreach>
			</select> &nbsp;&nbsp;
			<input type="submit" class="btn btn-primary" value="搜索" />
         <a class="btn btn-danger" href="{:url('Goods/index')}">清空</a>
        </form>
		<table class="table table-hover table-bordered">
			<thead>				
				<tr>
					<th width="40">ID</th>
					<th align="left">商品名称</th>
					<th align="left">所属类别</th>
					<th align="left">店铺类型</th>
					<th align="left">原价</th>
					<th align="left">会员价格</th>
					<th align="left">图片</th>
					<th width="160">操作</th>
				</tr>
			</thead>
			<tbody>
				<foreach name="data" item="vo">				
				<tr>
					<td>{$vo.g_id}</td>
					<td>{$vo.g_goodsname}</td>
					<td>{$vo['g_category']|getCname}</td>
					<td>{$vo['cat_name']}</td>
					<td>{$vo['g_price']}</td>
					<td>{$vo['g_vipprice']}</td>
					<td>
						<div class="example col-xs-6 col-md-6">
						<p><img src="__ROOT__/upload/{$vo.g_pic}" class="img-rounded" alt="" width='50' height='50'></p>
						</div>
					</td>
					<td>
						<if condition="$vo['g_status'] eq 1">
                            <a class="js-ajax-dialog-btn"
                               href="{:url('Goods/upStatus',['g_id'=>$vo['g_id'],'g_status'=>0])}">禁用</a>
                            <else/>
                            <a class="js-ajax-dialog-btn"
                               href="{:url('Goods/upStatus',['g_id'=>$vo['g_id'] ,'g_status'=>1])}">启用</a>
                         </if>
						<!-- <a href="{:url('Goods/edit',array('g_id'=>$vo['g_id']))}">{:lang('EDIT')}</a> -->
						<!-- <a href="{:url('Goods/updates',array('id'=>$vo['g_id']))}">更新</a> -->
						<a class="js-ajax-delete" href="{:url('Goods/delete',array('g_id'=>$vo['g_id']))}">{:lang('DELETE')}</a>
						<!--<a href="javascript:parent.openIframeLayer('{:url('Format/index',array('pid'=>$vo['g_id']))}',{});">规格</a>-->
					</td>
				</tr>
				</foreach>
			</tbody>
		</table>
		<div class="pagination">{$page}</div>
	</div>
	<script src="__TMPL__/public/assets/js/zoomify.min.js"></script>
	<script type="text/javascript">
		$('.example img').zoomify();
	</script>
	<script src="__STATIC__/js/admin.js"></script>
</body>
<script>

</script>
</html>